package com.huawei.appgallery.assistantdock.buoydock.card.card;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.huawei.appgallery.assistantdock.base.cardkit.bean.BuoyBaseCardBean;
import com.huawei.appgallery.assistantdock.base.cardkit.card.BuoyBaseCard;
import com.huawei.appgallery.assistantdock.buoydock.card.bean.BuoyForumNoticeCardBeanBuoy;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.ArrayList;
import java.util.List;
import o.beo$e;
import o.beq;
import o.bgf;
import o.cgz;
import o.chy;

public class BuoyForumNoticeCardBuoy extends BuoyBaseCard implements OnClickListener {
    private List<BuoyBaseCard> ˊ = new ArrayList();
    protected chy ˋ;

    public /* synthetic */ cgz ˏ(View view) {
        return ॱ(view);
    }

    public BuoyForumNoticeCardBuoy(Context context) {
        super(context);
    }

    public BuoyBaseCard ॱ(View view) {
        ʽ(view);
        return this;
    }

    public BuoyBaseCard ˋ(int i) {
        if (this.ˊ == null || i < 0 || i >= this.ˊ.size()) {
            return null;
        }
        return (BuoyBaseCard) this.ˊ.get(i);
    }

    public void ˊ(BuoyBaseCard buoyBaseCard) {
        if (buoyBaseCard != null) {
            this.ˊ.add(buoyBaseCard);
        }
    }

    public void ˊ() {
        this.ˊ.clear();
    }

    public int ˋ() {
        return this.ˊ.size();
    }

    public void ˏ(CardBean cardBean) {
        int size;
        super.ˏ(cardBean);
        BuoyForumNoticeCardBeanBuoy buoyForumNoticeCardBeanBuoy = (BuoyForumNoticeCardBeanBuoy) cardBean;
        if (buoyForumNoticeCardBeanBuoy.ˊ() != null) {
            size = buoyForumNoticeCardBeanBuoy.ˊ().size();
        } else {
            size = 0;
        }
        TextView textView = (TextView) ˉ().findViewById(beo$e.ᐨ);
        if (textView != null) {
            textView.setText(cardBean.v_());
        }
        textView = (TextView) ˉ().findViewById(beo$e.ॱʻ);
        if (textView != null) {
            textView.setOnClickListener(this);
        }
        int ˋ = ˋ();
        String ˎ = ˎ();
        for (int i = 0; i < ˋ; i++) {
            BuoyBaseCard ˋ2 = ˋ(i);
            if (ˋ2 != null && (ˋ2 instanceof BuoyForumNoticeItemCardBuoy)) {
                BuoyForumNoticeItemCardBuoy buoyForumNoticeItemCardBuoy = (BuoyForumNoticeItemCardBuoy) ˋ2;
                if (i >= size) {
                    buoyForumNoticeItemCardBuoy.ˉ().setVisibility(8);
                } else {
                    buoyForumNoticeItemCardBuoy.ˉ().setVisibility(0);
                    CardBean cardBean2 = (BuoyBaseCardBean) buoyForumNoticeCardBeanBuoy.ˊ().get(i);
                    cardBean2.ˋˋ(cardBean.ॱˉ());
                    buoyForumNoticeItemCardBuoy.ˋ(ˎ);
                    buoyForumNoticeItemCardBuoy.ˏ(cardBean2);
                    buoyForumNoticeItemCardBuoy.ॱ(this.ˋ);
                }
            }
        }
    }

    public void ॱ(chy o_chy) {
        this.ˋ = o_chy;
    }

    public void onClick(View view) {
        if (view.getId() == beo$e.ॱʻ && this.ˊᐝ != null) {
            bgf.ˊ().ˊ(this.ʼॱ, this.ˊᐝ.ॱॱ());
            beq.ˊ(this.ˊᐝ.ॱॱ());
            if (this.ˊᐝ instanceof BaseCardBean) {
                beq.ˎ((BaseCardBean) this.ˊᐝ);
            }
        }
    }
}
